import Vue from 'vue'
import VueRouter from 'vue-router';
import login from '@/Login.vue';

Vue.use(VueRouter);

export default new VueRouter({
  mode: 'hash',
  //component不得为空
  routes: [
    {
      path: '/',
      name: '/',
      // redirect: "home",
      redirect: "Login",
      component: () => import('@/page/home/user'),
      // component: () => import('@/Login.vue'),
      children: [
        {//登录
          path: '/login',
          name: 'login',
          component: login
        },
        {//首页
          path: '/home',
          name: 'home',
          component: () => import('@/page/home/home')
        },
        {//选择城市-开始
          path: '/selectCity',
          name: 'selectCity',
          component: () => import('@/page/home/selectCity')
        },
        {//维修开始
          path: '/repair',
          name: 'repair',
          component: () => import('@/page/using/repair/index.vue'),
        },
        {
          path: '/immediatelyReservation',
          name: 'immediatelyReservation',
          component: () => import('@/page/using/repair/immediatelyReservation.vue'),
        },
        {
          path: '/reservationOk',
          name: 'reservationOk',
          component: () => import('@/page/using/repair/reservationOk.vue'),
        },
        {
          path: '/storeDetails',
          name: 'storeDetails',
          component: () => import('@/page/using/repair/storeDetails.vue'),
        },
        {
          path: '/storeDetailsNavigation',
          name: 'storeDetailsNavigation',
          component: () => import('@/page/using/repair/storeDetailsNavigation.vue'),
        },
        {
          path: '/reservationDetails',
          name: 'reservationDetails',
          component: () => import('@/page/using/repair/reservationDetails.vue'),
        },
        {
          path: '/nearbyStores',
          name: 'nearbyStores',
          component: () => import('@/page/using/repair/nearbyStores.vue'),
        },//维修待结束
        {//保养-开始
          path: '/keepIndex',
          name: 'keepIndex',
          component: () => import('@/page/using/upKeep/index')
        },
        {
          path: '/upNearby',
          name: 'upNearby',
          component: () => import('@/page/using/upKeep/nearby')
        },
        {
          path: '/upWash',
          name: 'upWash',
          component: () => import('@/page/using/upKeep/wash')
        },
        {
          path: '/upNavigation',
          name: 'upNavigation',
          component: () => import('@/page/using/upKeep/navigation')
        },
        {
          path: '/upConfirmOrder',
          name: 'upConfirmOrder',
          component: () => import('@/page/using/upKeep/confirmOrder')
        },
        {
          path: '/upCard',
          name: 'upCard',
          component: () => import('@/page/using/upKeep/card')
        },
        {
          path: '/upPayOrder',
          name: 'upPayOrder',
          component: () => import('@/page/using/upKeep/payOrder')
        },
        {
          path: '/upOrderInfo',
          name: 'upOrderInfo',
          component: () => import('@/page/using/upKeep/orderInfo')
        },
        {
          path: '/upSelectCar',
          name: 'upSelectCar',
          component: () => import('@/page/using/upKeep/selectCar')
        },//保养-待结束
        {//洗车-开始
          path: '/wash',
          name: 'wash',
          component: () => import('@/page/using/washCar/wash')
        },
        {
          path: '/washCar',
          name: 'washCar',
          component: () => import('@/page/using/washCar/washCar')
        },
        {
          path: '/confirmOrder',
          name: 'confirmOrder',
          component: () => import('@/page/using/washCar/confirmOrder')
        },
        {
          path: '/payOrder',
          name: 'payOrder',
          component: () => import('@/page/using/washCar/payOrder')
        },
        {
          path: '/orderInfo',
          name: 'orderInfo',
          component: () => import('@/page/using/washCar/orderInfo')
        },
        {
          path: '/card',
          name: 'card',
          component: () => import('@/page/using/washCar/card')
        },
        {
          path: '/selectCar',
          name: 'selectCar',
          component: () => import('@/page/using/washCar/selectCar')
        },//洗车-结束
        {// 应急-开始
          path: '/rescueIndex',
          name: 'rescueIndex',
          component: () => import('@/page/using/rescue/index')
        },
        {
          path: '/rescuerecord',
          name: 'rescuerecord',
          component: () => import('@/page/using/rescue/record')
        },// 应急-结束
        {//加油开始
          path: '/refuel/refuelList',
          name: 'refuelList',
          component: () => import('../page/using/refuel/refuelList.vue')
        },
        {
          path: '/refuel/refuelMap',
          name: 'refuelMap',
          component: () => import('../page/using/refuel/refuelMap.vue')
        },
        {
          path: '/using/details',
          name: 'details',
          component: () => import('../page/using/refuel/refuelDetails.vue')
        },
        {
          path: '/using/navigation',
          name: 'navigation',
          component: () => import('../page/using/refuel/navigation.vue')
        },
        {//message-消息中心
          path: '/using/message',
          name: 'message',
          component: () => import('../page/using/message/index.vue')
        },
        {
          path: '/using/discounts',
          name: 'discounts',
          component: () => import('../page/using/discounts/index.vue')
        },
        {
          path: '/using/offerDetails',
          name: 'offerDetails',
          component: () => import('../page/using/discounts/offerDetails.vue')
        },//加油结束
        {//我的开始
          path: '/mine',
          name: 'mine',
          component: () => import('../page/mine/index.vue'),

        },
        {
          path: '/orderinfo2',
          name: 'orderinfo2',
          component: () => import('../page/mine/Order/orderinfo/orderinfo2.vue'),
        },
        {
          path: '/evaluate',
          name: "evaluate",
          component: () => import('../page/mine/Order/Evaluate.vue'),
        },
        {
          path: '/allorder',
          name: 'allorder',
          component: () => import('../page/mine/Order/AllOrder.vue'),
        },
        {
          path: '/userinfo',
          name: 'userinfo',
          component: () => import('../page/mine/userinfo.vue'),
        },
        {
          path: '/phoneinfo',
          name: 'phoneinfo',
          component: () => import('../page/mine/phoneinfo.vue'),
        },
        {
          path: '/myWash',
          name: 'myWash',
          component: () => import('../page/mine/myWash'),
        },
        {
          path: '/washInfo',
          name: 'washInfo',
          component: () => import('../page/mine/myWash/washInfo.vue'),
        },//我的待结束
        {//我的车辆开始
          path: '/myCar',
          name: 'myCar',
          component: () => import('../page/mine/myCar/mycar')
        },
        {
          path: '/addSucceed',
          name: 'addSucceed',
          component: () => import('../page/mine/myCar/addSucceed')
        },
        {
          path: '/addcar',
          name: 'addCar',
          component: () => import('../page/mine/myCar/addCar')
        },//我的-车辆结束
        {//我的-消费记录
          path: '/record',
          name: 'record',
          component: () => import('../page/mine/myCar/Record')
        },
        {//我的-领劵中心开始
          path: '/couponCenter',
          name: 'couponCenter',
          component: () => import('../page/mine/myCoupon/couponCenter')
        },
        {//我的-优惠劵开始
          path: '/couponheader',
          name: 'couponHeader',
          component: () => import('../page/mine/myCoupon/couponHeader'),
          children: [
            {//未使用
              path: '/couponHeader/couponUnused',
              name: 'coupon1',
              component: () => import('../page/mine/myCoupon/couponUnused')
            },
            {//已使用
              path: '/couponHeader/couponUsed',
              name: 'coupon2',
              component: () => import('../page/mine/myCoupon/couponUsed')
            },
            {//已过期
              path: '/couponHeader/couponOutdate',
              name: 'coupon3',
              component: () => import('../page/mine/myCoupon/couponOutdate')
            }
          ]
        }//我的-优惠劵结束
      ]
    }

  ]
})